package ch.unisi.inf.pfii.teamwhite.risk.buildings;

import java.util.ArrayList;

import junit.framework.TestCase;
import ch.unisi.inf.pfii.teamwhite.risk.core.Planet;
import ch.unisi.inf.pfii.teamwhite.risk.core.player.Human;
import ch.unisi.inf.pfii.teamwhite.risk.core.player.Player;

public class BuildingTest extends TestCase {

private ArrayList<Planet> planets;

	public void testBuilding()
	{
		Building building1 = new TaxCenter();
		assertEquals(true ,building1.getName().equals("Tax Center"));
	}
	
	public void testSlaveryCamp()
	{
		SlaveryCamp building3 =new SlaveryCamp();
		Player player1 = new Human("User");
	    Planet planet1 = new Planet("User", player1 ,890);
	    building3.slavery(planet1);
	    assertEquals(1500, planet1.getMoney());
	}
	
	public void testTaxCenter()
	{
		TaxCenter building4 = new TaxCenter();
		Player player1 = new Human("User1");
	    Planet planet1 = new Planet("Mars", player1 ,100);
	    Planet planet2 = new Planet("Venus", player1 ,0);
	    Planet planet3 = new Planet("Mercury", player1 ,50);
	    planets = new ArrayList<Planet>();
	    planets.add(planet1);
	    planets.add(planet2);
	    planets.add(planet3);
	    building4.extraIncome(planets);
	    assertEquals(building4.extraIncome(planets),15);	    
	}
	
	public void testEldestCouncil()
	{
		EldestCouncil eldestCouncil = new EldestCouncil(); 
		planets = new ArrayList<Planet>();
		Player player1 = new Human("User1");
	    Planet planet1 = new Planet("Mars", player1 ,0);
	    Planet planet2 = new Planet("Venus", player1 ,50);
	    Planet planet3 = new Planet("Mercury", player1 ,100);

		planets = new ArrayList<Planet>();
	    planets.add(planet1);
	    planets.add(planet2);
	    planets.add(planet3);
	 
		assertTrue(eldestCouncil.bonus(planets, planet3) == 15 + 1500);
		assertTrue(planet3.getShips().size() == 1);
	}

	}
